#include <iostream>
#include <cmath>
int main()
{
	int n, m;
	std::cin >> n >> m;
	if (n > m)
	{
		m = m ^ n;
		n = m ^ n;
		m = m ^ n;
	}
	std::cout << std::pow((double)m, (double)n);
}